package clould.springcloud.entity;

import clould.springcloud.Enum.CommonResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor

public class CommontsResult<T>
{
    private int code;
    private String msg;
    private T data;

    public CommontsResult(int code,String msg)
    {
        this(code,msg,null);
    }

    public CommontsResult success( T data )
    {
        return new CommontsResult(200,"成功",data);
    }

    public CommontsResult failed(){
        return new CommontsResult(-9999,"失败");
    }
}
